﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Modules.crew.ui {
    import flash.display.*;
    import flash.utils.*;
    import Classes.*;
    import flash.filters.*;
    import ZLocalization.*;
    import Display.*;
    import flash.text.*;

    public class CrewRewardSprite extends Sprite {

        protected var m_bg:DisplayObject;
        private var m_rewardAmount:TextField;
        private var m_rewardFormat:TextFormat;
        private var m_responses:TextField;
        private var m_responseFormat:TextFormat;
        private var m_xoffset:int;
        private var m_yoffset:int;
        protected var m_completeCheck:DisplayObject;
        protected var m_rewardImage:DisplayObject;
        protected var m_assets:Dictionary;

        public function CrewRewardSprite(_arg1:Dictionary, _arg2:DisplayObject, _arg3:Boolean, _arg4:Number=0, _arg5:Number=0){
            this.m_assets = _arg1;
            this.m_rewardImage = _arg2;
            this.m_xoffset = 0;
            this.m_yoffset = 30;
            if (_arg3){
                this.m_xoffset = 15;
                this.m_yoffset = 15;
            };
            this.m_bg = (_arg3) ? (new (_arg1["payroll_rewardBG_green"])() as DisplayObject) : (new (_arg1["payroll_rewardBG_blue"])() as DisplayObject);
            addChild(this.m_bg);
            this.m_bg.x = this.m_xoffset;
            this.m_bg.y = this.m_yoffset;
            addChild(this.m_rewardImage);
            this.m_rewardImage.x = (((this.m_bg.width - this.m_rewardImage.width) / 2) + this.m_xoffset);
            this.m_rewardImage.y = (((this.m_bg.height - this.m_rewardImage.height) / 2) + this.m_yoffset);
            var _local6:uint = (_arg3) ? EmbeddedArt.lightOrangeTextColor : EmbeddedArt.rollCallStatusBlue;
            this.m_rewardAmount = new TextField();
            this.m_rewardAmount.text = String(_arg4);
            this.m_rewardAmount.selectable = false;
            this.m_rewardAmount.embedFonts = true;
            this.m_rewardAmount.antiAliasType = AntiAliasType.ADVANCED;
            this.m_rewardAmount.gridFitType = GridFitType.PIXEL;
            this.m_rewardAmount.autoSize = TextFieldAutoSize.CENTER;
            this.m_rewardAmount.filters = [new GlowFilter(0xFFFFFF, 1, 6, 6, 10, BitmapFilterQuality.LOW), new DropShadowFilter(1, 90, 0, 0.4, 3, 3)];
            this.m_rewardFormat = new TextFormat();
            this.m_rewardFormat.font = EmbeddedArt.TITLE_FONT;
            this.m_rewardFormat.color = _local6;
            this.m_rewardFormat.align = TextFormatAlign.CENTER;
            this.m_rewardFormat.size = 22;
            this.m_rewardAmount.setTextFormat(this.m_rewardFormat);
            addChild(this.m_rewardAmount);
            if (_arg3){
                this.m_rewardAmount.x = (this.m_rewardAmount.x + this.m_xoffset);
            };
            this.m_rewardAmount.y = (70 + this.m_yoffset);
            this.m_responses = new TextField();
            var _local7:LocalizationObjectToken = ZLoc.tk("Dialogs", "Response", "", _arg5);
            this.m_responses.text = TextFieldUtil.formatSmallCapsString(ZLoc.t("Dialogs", "RollCall_responsesRequired", {
                amount:String(_arg5),
                response:_local7
            }));
            this.m_responses.selectable = false;
            this.m_responses.embedFonts = true;
            this.m_responses.multiline = true;
            this.m_responses.width = 93;
            this.m_responses.wordWrap = true;
            this.m_responses.antiAliasType = AntiAliasType.ADVANCED;
            this.m_responses.gridFitType = GridFitType.PIXEL;
            this.m_responses.autoSize = TextFieldAutoSize.CENTER;
            this.m_responseFormat = new TextFormat();
            this.m_responseFormat.font = EmbeddedArt.DEFAULT_FONT_NAME_BOLD;
            this.m_responseFormat.color = EmbeddedArt.brownTextColor;
            this.m_responseFormat.align = TextFormatAlign.CENTER;
            this.m_responseFormat.size = 12;
            this.m_responses.setTextFormat(this.m_responseFormat);
            if (((!((_arg5 == 0))) && (!(_arg3)))){
                addChild(this.m_responses);
            };
            this.m_completeCheck = (new (_arg1["payroll_checkmark_reward"])() as DisplayObject);
            if (_arg3){
                addChild(this.m_completeCheck);
            };
        }
        public function update(_arg1:Boolean):void{
            this.m_xoffset = 0;
            this.m_yoffset = 30;
            if (_arg1){
                this.m_xoffset = 15;
                this.m_yoffset = 15;
            };
            this.m_rewardImage.x = (((this.m_bg.width - this.m_rewardImage.width) / 2) + this.m_xoffset);
            this.m_rewardImage.y = (((this.m_bg.height - this.m_rewardImage.height) / 2) + this.m_yoffset);
            this.m_bg = (_arg1) ? (new (this.m_assets["payroll_rewardBG_green"])() as DisplayObject) : (new (this.m_assets["payroll_rewardBG_blue"])() as DisplayObject);
            this.m_bg.x = this.m_xoffset;
            this.m_bg.y = this.m_yoffset;
            var _local2:uint = (_arg1) ? EmbeddedArt.lightOrangeTextColor : EmbeddedArt.rollCallStatusBlue;
            this.m_rewardFormat.color = _local2;
            this.m_rewardAmount.setTextFormat(this.m_rewardFormat);
            if (_arg1){
                this.m_rewardAmount.x = (this.m_rewardAmount.x + this.m_xoffset);
            };
            this.m_rewardAmount.y = (70 + this.m_yoffset);
            if (_arg1){
                addChild(this.m_completeCheck);
            };
        }

    }
}//package Modules.crew.ui 
